#include <iostream>
#include <algorithm>
using namespace std;

const int N = 1e5 + 10;

int n;
int a[N];
int disc[N]; // 离散化数组
int pos; // 离散化数组的元素个数
// 二分查找x的位置
int find(int x)
{
    int left = 1, right = pos;
    while(left < right)
    {
        int mid = (left + right) / 2;
        if(a[mid] >= x) right = mid;
        else left = mid + 1;
    }
    return left;
}
int main()
{
    cin >> n;
    for(int i = 1; i <= n; i++)
    {
        cin >> a[i];
        disc[++pos] = a[i];
    }
    // 排序
    sort(disc + 1, disc + 1 + pos);
    // 去重
    pos = unique(disc + 1, disc + 1 + pos) - (disc + 1);
    
    for(int i = 1; i <= n; i++)
    {
        cout << a[i] << "离散化之后" << find(a[i]) << endl;
    }

    return 0;
}